package cn.edu.wynu.api.generics;

/**
 * 自己创建的泛型类代码，用于讲解泛型
 * @author zrk
 * @param <A>
 */
public class MyArrayList<A> {
    private A[] array;
    private int index = 0;

    public MyArrayList(A[] array) {
        this.array = array;
    }

    public void add(A a){
        array[this.index] = a;
        this.index++;
    }
}
